home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / xcmd / dxcmds34.sit / Dartmouth XCMD's 3.4.3 / card_19072.txt < prev    next >
Text File  |  1990-04-17  |  3KB  |  139 lines

  1. -- card: 19072 from stack: in.3
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3241
  5. -- name: AuxActive
  6. ----- HyperTalk script -----
  7. on Install
  8.   get ChooseTargetStack()
  9.   InstallResource XFCN,AuxActive,it
  10. end Install
  11.  
  12.  
  13. -- part 1 (button)
  14. -- low flags: 00
  15. -- high flags: A003
  16. -- rect: left=80 top=300 right=322 bottom=180
  17. -- title width / last selected line: 0
  18. -- icon id / first selected line: 0 / 0
  19. -- text alignment: 1
  20. -- font id: 0
  21. -- text size: 12
  22. -- style flags: 0
  23. -- line height: 16
  24. -- part name: OS Snitcher
  25. ----- HyperTalk script -----
  26. on mouseUp
  27.   if AuxActive() then answer "A/UX is running."
  28.   else answer "Macintosh OS is running."
  29. end mouseUp
  30.  
  31.  
  32.  
  33. -- part 2 (button)
  34. -- low flags: 00
  35. -- high flags: A003
  36. -- rect: left=299 top=300 right=322 bottom=438
  37. -- title width / last selected line: 0
  38. -- icon id / first selected line: 0 / 0
  39. -- text alignment: 1
  40. -- font id: 0
  41. -- text size: 12
  42. -- style flags: 0
  43. -- line height: 16
  44. -- part name: Show Pascal Source
  45. ----- HyperTalk script -----
  46. on mouseUp
  47.   set the visible of card field 1 to not the visible of card field 1
  48.   if the visible of card field 1 is true then
  49.     set the name of me to "Hide Pascal Source"
  50.   else set the name of me to "Show Pascal Source"
  51. end mouseUp
  52.  
  53.  
  54.  
  55. -- part 3 (field)
  56. -- low flags: 81
  57. -- high flags: 2007
  58. -- rect: left=12 top=26 right=298 bottom=491
  59. -- title width / last selected line: 0
  60. -- icon id / first selected line: 0 / 0
  61. -- text alignment: 0
  62. -- font id: 22
  63. -- text size: 10
  64. -- style flags: 0
  65. -- line height: 13
  66. -- part name: Source
  67.  
  68.  
  69. -- part contents for background part 16
  70. ----- text -----
  71. AUXACTIVE XFCN version 1.0
  72. Kevin Calhoun
  73.  
  74. AuxActive returns true if HyperCard is running under A/UX and false if HyperCard is running under the Macintosh OS.  This information is especially useful to developers who rely on XCMD's that may not work under A/UX.
  75.  
  76. Compatibility of the Dartmouth XCMD's with A/UX:
  77.  
  78. SerialHandler is known not to work under A/UX, PrintField and TextStream have yet to be tested, and the remainder of the XCMD's and XFCN's in this stack have been tested under A/UX only cursorily.  They appear to work, but we recommend that you subject them to your own testing before relying on them for use under any operating system other than Macintosh OS.
  79.  
  80. -- part contents for card part 3
  81. ----- text -----
  82. UNIT AUX;
  83.  
  84. { XFCN AuxActive ┬⌐ 1989 by the Trustees of Dartmouth College }
  85. { Written by Kevin Calhoun }
  86.  
  87. { This source compatible with MPW Pascal 3.0 }
  88.  
  89. (*
  90. Pascal AuxActive.p
  91. Link -m ENTRYPOINT Γêé
  92.   -o "YourFile" Γêé
  93. -rt XFCN=1967 Γêé
  94. -sn Main=AuxActive Γêé
  95. AuxActive.p.o Γêé
  96. "{Libraries}"interface.o Γêé
  97. "{PLibraries}"Paslib.o Γêé
  98. "{Libraries}"HyperXLib.o
  99. *)
  100.  
  101. {$R-}
  102.  
  103. INTERFACE
  104.   USES
  105.     ToolUtils,
  106.     HyperXCmd;
  107.     
  108.   PROCEDURE Entrypoint(paramPtr: XCMDPtr);
  109.   
  110.   IMPLEMENTATION
  111.   
  112.   PROCEDURE CheckForAUX(paramPtr: XCMDPtr); FORWARD;
  113.  
  114.   PROCEDURE Entrypoint(paramPtr: XCMDPtr);
  115.   BEGIN
  116.     CheckForAUX(paramPtr);
  117.   END;
  118.   
  119.     FUNCTION AuxActive: BOOLEAN;
  120.   { If A/UX is active, bit 9 of the word at $B22 is set.
  121.     If Mac OS is active, that bit is clear. }
  122.     CONST
  123.       HWCfgFlags = $B22;
  124.   BEGIN
  125.     AuxActive := BitTst(Ptr(HWCfgFlags),6);
  126.     { "6" is not a typo!  The toolbox BitTst routine takes
  127.       an offset from the high order bit of the byte pointed to
  128.       by the first param. }
  129.   END;
  130.   
  131.   PROCEDURE CheckForAUX(paramPtr: XCMDPtr);
  132.     VAR
  133.       s: Str255;
  134.   BEGIN
  135.     BoolToStr(paramPtr,AuxActive,s);
  136.     paramPtr^.returnValue := PasToZero(paramPtr,s);
  137.   END;
  138.  
  139. END.